const validate = {
  name1: [
    {
      required: true,
      message: '请选择状态',
      trigger: 'change'
    }
  ]
  // name2: [
  //   {
  //     required: true,
  //     message: '请输入供应商',
  //     trigger: 'change'
  //   }
  // ]
}

const validate2 = {
  name1: [
    {
      required: true,
      message: '请输入结算单名称',
      trigger: 'change'
    }
  ],
  name3: [
    {
      required: true,
      message: '请上传文件',
      trigger: 'change'
    }
  ]
}

var validatorPhone = function(rule, value, callback) {
  if (value === '') {
    callback(new Error('请输入企业联系电话'))
  } else if (!/^1\d{10}$/.test(value)) {
    callback(new Error('请输入正确的企业联系电话'))
  } else {
    callback()
  }
}

const validateDetail = {
  name2: [
    {
      required: true,
      message: '请输入统一社会信用代码',
      trigger: 'change'
    }
  ],
  // name3: [
  //   {
  //     required: true,
  //     trigger: 'change',
  //     validator: validatorPhone
  //   },
  //   { type: 'number', message: '请输入正确的企业联系电话' }
  // ],
  name5: [
    {
      required: true,
      message: '请输入验证码',
      trigger: 'change'
    },
    { type: 'number', message: '请输入数字' }
  ]
}
export {
  validate,
  validate2,
  validateDetail
}
